home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
ForCLI
/
0Utils13.lha
/
0Utils
/
.c.Template
next >
Wrap
Text File
|
1995-03-20
|
3KB
|
124 lines
/******************************************************************************
MODULE
$(NAME).c
DESCRIPTION
NOTES
Kickstart 2.0+ required
compiles w/ SAS/C v6.51
BUGS
none known
TODO
EXAMPLES
SEE ALSO
INDEX
HISTORY
(12-02-95 b_noll T created .c.Template)
(20-02-95 b_noll T added includes section)
(21-02-95 b_noll T added version/format-prefix/offset)
(20-03-95 b_noll T added args diagnostics)
$(DATE) b_noll created
AUTHOR
Bernd Noll, Brunnenstrasse 55, D-67661 Kaiserslautern
b_noll@informatik.uni-kl.de
******************************************************************************/
/**************************************
Includes
**************************************/
#ifndef EXEC_LIBRARIES_H
# include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef CLIB_EXEC_PROTOS_H
# include <clib/exec_protos.h>
#endif /* CLIB_EXEC_PROTOS_H */
#ifndef DOS_DOS_H
# include <dos/dos.h>
#endif /* DOS_DOS_H */
#ifndef CLIB_DOS_PROTOS_H
# include <clib/dos_protos.h>
#endif /* CLIB_DOS_PROTOS_H */
#include <proto/dos.h>
#include <proto/exec.h>
/* ******************** USER INCLUDES ******************** */
/* ******************** USER INCLUDES ******************** */
/**************************************
Defines & Structures
**************************************/
struct _arg {
/* ******************** USER FORMAT ******************** */
#define FORMAT "$(FORMAT)"
/* ******************** USER FORMAT ******************** */
}; /* struct _argv */
#define MAXPATHLEN 256
#define MAXLINELEN 256
#define VERSIONPREFIX "$VER: "
#define VERSIONOFFSET 0
#define FORMATPREFIX "$ARG: "
#define FORMATOFFSET 6
/**************************************
Implementation
**************************************/
long _main (void)
{
const char* version = VERSIONPREFIX "$(NAME) 1.0 " __AMIGADATE__ + VERSIONOFFSET;
long retval = RETURN_FAIL;
struct Library* SysBase = *((struct Library**)4L);
struct Library* DOSBase;
if (DOSBase = OpenLibrary (DOSNAME, 37)) {
struct _arg argv = { 0 };
APTR args;
retval = RETURN_ERROR;
if (args = (void*)ReadArgs(FORMATPREFIX FORMAT + FORMATOFFSET, (LONG*)&argv, NULL)) {
retval = RETURN_OK;
/* ******************** USER BODY ******************** */
/* ******************** USER BODY ******************** */
FreeArgs (args);
} /* if */
if (retval > RETURN_WARN)
PrintFault(IoErr(), "$(NAME)");
CloseLibrary (DOSBase);
} /* if */
return (retval);
} /* _main */
/******************************************************************************
***** END $(NAME).c
******************************************************************************/